package com.wing.purchase.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.purchase.model.entity.PurchaseDeliveryRecordProduct;
import com.wing.purchase.model.response.PurchaseDeliveryRecordProductVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 供应商发货记录产品-Dao
 *
 * @author
 */
@Mapper
public interface PurchaseDeliveryRecordProductDao extends BaseMapper<PurchaseDeliveryRecordProduct> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<PurchaseDeliveryRecordProductVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<PurchaseDeliveryRecordProductVO> list4app(@Param("page") Page<PurchaseDeliveryRecordProductVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    PurchaseDeliveryRecordProductVO get4appById(Long id);

    /**
     * 获取发货数量
     * @param purchaseDeliveryRecordId
     * @return
     */
    List<PurchaseDeliveryRecordProductVO> getPurchaseDeliveryRecordProduct(@Param("purchaseDeliveryRecordId") Long purchaseDeliveryRecordId);

    /**
     * 根据签收记录ID 获取发货id
     * @param purchaseSignForId
     * @return
     */
    Long getPurchaseDeliveryRecordIdBySignForId(@Param("purchaseSignForId") Long purchaseSignForId);

    /**
     * 查询对应发货id的发货记录清空
     * @param purchaseDeliveryRecordId
     * @return
     */
    List<PurchaseDeliveryRecordProductVO> getPurchaseDeliveryRecordList(@Param("purchaseDeliveryRecordId") Long purchaseDeliveryRecordId);

}
